#include "Gray.h"
#include "../utils/Logger.h"

Gray::Gray() {
}

Gray::~Gray() {
}

IplImage* Gray::apply(const IplImage* in) {
    Log << "Applying gray effect" << endl;
    IplImage *out = cvCreateImage(cvSize(in->width, in->height), in->depth, 1);
    if (1 == in->nChannels)
        cvCopy(in, out);
    else
        cvCvtColor(in, out, CV_BGR2GRAY);
    return out;
}
